import Vue from 'vue'
import Vuex from 'vuex'
import { getStorage, setStorage } from '@/utils/storage.js'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userinfo: getStorage('userinfo')
  },
  mutations: {
    setUser (state, payload) {
      state.userinfo = payload
      setStorage('userinfo', payload)
    }
  },
  actions: {
  },
  modules: {
  }
})
